package com.atguigu.tingshu.search.rpc;

import com.atguigu.tingshu.common.result.Result;
import com.atguigu.tingshu.search.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/rpc/inner/searchInfo")
@RestController
public class SearchInfoRpcController {

    @Autowired
    private ItemService itemService;
    @PostMapping("/preRankingCache")
    Result<Boolean> preRankingCache(){
        try {
            itemService.preRankingCache();
            return Result.ok(true);
        }catch (Exception e){
            return Result.ok(false);
        }
    }
}
